<#assign pageTitle = "我的资料" />
<#assign pageHeader>
</#assign>
<#assign pageContent>
    <article class="w80 fl">
        <div class="u-r-cont">
            <section>
                <div class="">
                    <section class="u-r-tit-all">
                        <h2 class="unFw">
                            <span><a
                                        href="/user/document/list.html?status=0">待审核(${notCount})</a></span>
                            <span><a
                                        href="/user/document/list.html?status=1">已通过(${pastCount})</a></span>
                            <span><a
                                        href="/user/document/list.html?status=-1">被驳回(${refuseCount})</a></span>
                            <span class="current"><a href="/user/document/add.html">上传资料</a></span>
                        </h2>
                    </section>
                    <section class="u-r-all-box">
                        <div class="mem-body">
                            <form class="form-horizontal m" id="form-document-add">
                                <ul class='l-r-w-Inpt l-r-w-Inpt-tx'>
                                    <li class="mt20">
                                        <label class="layui-form-label vam">分类</label>
                                        <div class="layui-input-inline">
                                            <div class="layui-col-md10">
                                                <input type="text" id="category-tree"  name="categoryId" value="0" lay-filter="category-tree" class="lTxt">
                                            </div>
                                        </div>
                                    </li>
                                    <li class="mt20">
                                        <label class='vam'>类型：</label>
                                        <select style="width: 180px" name="typeId" id="typeId" class="lTxt" >
                                            <#list documentTypes as documentType>
                                                <option value="${documentType_index}">${documentType.title}</option>
                                            </#list>
                                        </select>
                                    </li>
                                    <li class="mt20">
                                        <label class='vam'>文件：</label>
                                        <input style="width: 400px" placeholder="请填写或上传资料" type='text' id='fileUrl' name='fileUrl' value="" class='lTxt'>
                                        <input type='hidden' id='fileSize' name='fileSize'>
                                        <a id="file-upload" class="cou-kscp big-all-btn" href="javascript:void(0)">上传资料</a>
                                    </li>
                                    <li class="mt20">
                                        <label class='vam'>标题：</label>
                                        <input style="width: 400px" placeholder="请输入资料名称" type='text' id="title" name='title' value="" class='lTxt'>
                                    </li>
                                    <li class="mt20">
                                        <label class='vam'>封面：</label>
                                        <input style="width: 400px" placeholder="请填写或上传资料封面" type='text' id='cover' name='cover' value="" class='lTxt'>
                                        <a id="cover-upload" class="cou-kscp big-all-btn" href="javascript:void(0)">上传图片</a>
                                        <a class="cou-kscp big-all-btn" id="view-cover" href="javascript:void(0)">预览</a>
                                    </li>

                                    <li class="mt20">
                                        <label class='vam'>详情：</label>
                                        <div  style="width: 80%;margin: auto;margin-top: -20px">
                                             <textarea id="intro" name="intro"></textarea>
                                        </div>
                                    </li>
                                    <li class="mt20">
                                        <label class='vam'>标签：</label>
                                        <input style="width: 400px" placeholder="标签：多个以'逗号'分开" type='text' id="tags" name='tags' value="" class='lTxt'>
                                    </li>
                                    <li class="mt20">
                                        <label class='vam'>售价：</label>
                                        <input style="width: 200px"  placeholder="请输入售价" type='text' id='mobile' name='price' value="0" class='lTxt'>
                                        <label class='vam'>等级：</label>
                                        <select style="width: 180px" name="levelId" id="levelId" class="lTxt" >
                                            <option value="0">普通</option>
                                            <#list members as member>
                                                <option value="${member.id}">${member.title}</option>
                                            </#list>
                                        </select>
                                    </li>
                                </ul>
                                <section class="u-o-right mt20 tac" style="width: 75%">
                                    <a class="cou-kscp big-all-btn" href="javascript:void(0)" onclick="addDocument()">提 交 资 料</a>
                                </section>
                            </form>
                        </div>
                    </section>
                </div>
            </section>
        </div>
    </article>
</#assign>
<#include "../layouts/layout_uc.ftl">
<script type="text/javascript" src="/static/libs/layui-v2.6.8/modules/treeSelect/treeSelect.js"></script>
<script type="text/javascript" src="/static/js/document/uc-document.js"></script>
<script type="text/javascript">
    layui.use(['layedit','treeSelect'],function () {
        var form = layui.form
            ,layedit = layui.layedit
            ,treeSelect = layui.treeSelect

        treeSelect.render({
            elem: '#category-tree',
            data: '/ajax/category/ztree.json',
            type: 'get',
            placeholder: '请选择分类',
            search: true, //是否开启搜索功能：true/false，默认false
            style: {
                folder: {
                    enable: false
                },
                line: {
                    enable: true
                }
            }
        });

        layedit.set({
            uploadImage: {
                url: '/user/upload/images.json', //接口url
                type: 'post' //默认post
            }
        })

        var editIndex = layedit.build('intro', {//建立编辑器
            tool: [
                'strong' //加粗
                ,'italic' //斜体
                ,'underline' //下划线
                ,'del' //删除线
                ,'|' //分割线
                ,'left' //左对齐
                ,'center' //居中对齐
                ,'right' //右对齐
                ,'link' //超链接
                ,'unlink' //清除链接
                ,'image' //清除链接
            ]
        });

        form.verify({
            content: function (value) {
                layedit.sync(editIndex);
            }
        });
    })

</script>

